import { Pagination } from 'antd';

interface PaginationProps {
    listData: any[];
    onChange: (page: number, pageSize: number) => void;
  }
function pagination(props: PaginationProps) {
    console.log(props.listData);
    const handleTableChange = (page: number, pageSize: number) => {
        props.onChange(page, pageSize);
      };
    return (
        <div style={{marginTop:'10px'}}>
            <Pagination
                total={props.listData.length}
                showSizeChanger
                showQuickJumper
                pageSize={5}
                onChange={handleTableChange}
                pageSizeOptions={[5,10,15,20,25]}
                showTotal={(total) => `共 ${total} 条`}
            />
        </div>
    );
}

export default pagination;